package com.dota.core.util;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

import com.dota.biz.user.domain.User;

public class SubjectUtil {
	public static User getUser() {
		Subject subject = SecurityUtils.getSubject();
		User principal = (User) subject.getPrincipal();
		if (principal != null) {
			return principal;
		} else {
			principal = new User();
			principal.setId(0);
		}
		return principal;

	}
}
